﻿@model FoodBank.Web.ViewModels.SignInViewModel
<div id="user-panel" class="float-left">
    <a id="open-info-dialog" href="#">
        @if (ViewBag.CurrentUserFullName != null)
        {
            <span>
                <img src="~/Images/status_online.png" alt="" />
                <label>@ViewBag.CurrentUserFullName</label>
            </span>
        }
        else
        {
            <span>
                <img src="~/Images/status_offline.png" alt="" />
                <label>@AccountResources.SignIn</label>
            </span>
        }
        <img id="options-button" src="~/Images/bullet_arrow_down.png" alt="" />
    </a>
    @if (ViewBag.CurrentUserFullName != null)
    {
        <div id="info-panel" class="hidden shadow">
            <ul>
                <li>
                    <em class="strong">@ViewBag.CurrentUserFullName</em>
                </li>
                <li>
                    <img src="~/Images/email.png" alt=""/>
                    <em style="margin-left: 3px">@ViewBag.CurrentUserEmail</em>
                </li>
                <li>
                    <img src="~/Images/cog.png" alt=""/>
                    <em>@Html.ActionLink(@AccountResources.UserSettings, "Settings", "Account")</em>
                </li>
                <li>
                    <img src="~/Images/door_out.png" alt=""/>
                    <em>@Html.ActionLink(@AccountResources.LogOut, "LogOff", "Account")</em>
                </li>
            </ul>
        </div>
    }
    else
    {
        <div id="info-panel" class="hidden shadow">
            @using (Html.BeginForm("SignIn", "Account", FormMethod.Post, new { @class = "no-validation-msg" }))
            {
                @Html.AntiForgeryToken()
                <ul>
                    <li>
                        @Html.TextBoxFor(x => x.UserName)
                    </li>
                    <li>
                        @Html.PasswordFor(x => x.Password)
                    </li>
                    <li class="clearfix">
                        @Html.CheckBoxFor(x => x.Remember)
                        <label for="Remember">@AccountResources.Remember</label>
                    </li>
                    <li class="float-right">
                        <input type="submit" value="@AccountResources.SignIn" class="float-left btn btn-white" />
                    </li>
                </ul>
                @Html.ActionLink(@AccountResources.Register, "Register", "Account", null, new { target = "_self" })
            }
        </div>
    }
</div>
